<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        /*静态注册*/
        var onblurFunc=function () {
            console.log("静态注册");
        }

        /*动态注册*/
        window.onload=function () {
            var password = document.getElementById("password");
            password.onblur=function () {
                console.log("动态注册");
            }
        }
    </script>
</head>
<body>
    <table>
        <tr>
            <td>用户名：</td>
            <td><input id="username" type="text" onblur="onblurFunc()"></td>
        </tr>
        <tr>
            <td>密码：</td>
            <td><input id="password" type="password"></td>
        </tr>
    </table>
</body>
</html>